export const saveToken = (token) => {
    saveValue("token", "bearer " + token);
};

export const saveValue = (key, value) => {
    if (value==null){
        localStorage.removeItem(key);
    }else {
        localStorage.setItem(key, value);
    }
};

export const getValue = (key) => {
    return localStorage.getItem(key);
};

export const getToken = () => {
    return getValue("token");
};

export const saveRefreshToken=(refreshToken)=>{
    saveValue("refresh_token",refreshToken);
};

export const getRefreshToken=()=>{
    return getValue("refresh_token");
};